home *** CD-ROM | disk | FTP | other *** search
/ Suzy B Software 2 / Suzy B Software CD-ROM 2 (1994).iso / extras / programm / a56 / src / a56.h next >
C/C++ Source or Header  |  1995-04-27  |  2KB  |  93 lines

  1. /*******************************************************
  2.  *
  3.  *  a56 - a DSP56001 assembler
  4.  *
  5.  *  Written by Quinn C. Jensen
  6.  *  July 1990
  7.  *
  8.  *******************************************************\
  9.  
  10. /*
  11.  * Copyright (C) 1990-1994 Quinn C. Jensen
  12.  *
  13.  * Permission to use, copy, modify, distribute, and sell this software
  14.  * and its documentation for any purpose is hereby granted without fee,
  15.  * provided that the above copyright notice appear in all copies and
  16.  * that both that copyright notice and this permission notice appear
  17.  * in supporting documentation.  The author makes no representations
  18.  * about the suitability of this software for any purpose.  It is
  19.  * provided "as is" without express or implied warranty.
  20.  *
  21.  */
  22.  
  23. /*
  24.  *  a56.h - general definitions
  25.  *
  26.  */
  27.  
  28. #include <stdio.h>
  29.  
  30. #ifndef TRUE
  31. #define TRUE 1
  32. #define FALSE 0
  33. #define NOT !
  34. typedef int BOOL;
  35. #endif
  36.  
  37. struct sym {
  38.     char *name;
  39.     struct n {
  40.     int type;
  41. #define UNDEF -1
  42. #define INT 0
  43. #define FLT 1
  44.     union val {
  45.         int i;
  46.         double f;
  47.         } val;
  48.     } n;
  49.     struct sym *next;
  50. } *find_sym();
  51.  
  52. extern int pass;
  53.  
  54. #define NEW(object) ((object *)alloc(sizeof(object)))
  55.  
  56. #define PROG 0
  57. #define XDATA 1
  58. #define YDATA 2
  59. #define LDATA 3
  60.  
  61. #define MAX_NEST 20    /* maximum include file nesting */
  62.  
  63. struct inc {
  64.     char *file;
  65.     FILE *fp;
  66.     int line;
  67. };
  68. extern struct inc inc[];
  69. extern int inc_p;
  70. #define curfile inc[inc_p].file
  71. #define curline inc[inc_p].line
  72.  
  73. extern int ldebug;
  74.  
  75. struct psect {
  76.     char *name;
  77.     int seg;
  78.     unsigned int pc, bottom, top;
  79.     struct psect *next;
  80. } *find_psect(), *new_psect();
  81.  
  82. FILE *open_read(), *open_write(), *open_append();
  83.  
  84.     /* save string s somewhere */
  85. #define strsave(s) ((s) != NULL ? \
  86.     (char *)strcpy((char *)malloc(strlen(s)+1),(s)) : NULL)
  87.  
  88.     /* after a call to fgets(), remove the newline character */
  89. #define rmcr(s) {if (s[strlen(s)-1] == '\n') s[strlen(s)-1] = '\0';};
  90.  
  91. #define ASSERT(expr, str) \
  92.     if(expr) fprintf(stderr, "ASSERT: %s: line %d: %s\n", __FILE__, __LINE__, str);
  93.